package webAction;

import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import cms_hibernate.article;
import tools.hbnHelper;

public class getArticleAction extends ActionSupport {
	public String requre()throws Exception{
		ActionContext context=ActionContext.getContext();
		if(!hbnHelper.CheckAdminSsPassword((String)context.getSession().get("email"), (String)context.getSession().get("password")))
		{
			return ERROR;
		}
		List<article> list= hbnHelper.requreArticle();
//		for(article temp:list) {
//			if(temp.getSummary().length()>50)
//			temp.setSummary(temp.getSummary().substring(0, 49));
//		}
		context.put("list",list);
		context.put("listsize", list.size());
		return SUCCESS;
//		context.put(key, value);
	}
}
